![]() |
PATH![]() |
![]() ![]() |
AppleScript is a scripting language that allows you to control Macintosh computers without using the keyboard or mouse. With AppleScript, you can use a series of English-like instructions, known as a script, to control applications, the Finder (or desktop), and many parts of the operating system. For example, Figure 2-1 shows the difference between closing an application window with the mouse and performing the same task with a script.
This guide describes how you can use AppleScript to write scripts. AppleScript shares many features with other scripting, programming, and macro languages. If you've used any of these languages, you'll find AppleScript's English-like terminology easy to learn and use. AppleScript provides the Script Editor application to help you create, compile, test, and modify scripts. You can easily create scripts that run as stand-alone applications, as described in Compiling Scripts With the Script Editor. You can also use the Script Editor to examine the scriptable operations and objects an application supports, as described in Dictionaries. For some applications, you can even record operations into a script to examine how the application implements scriptable features.
Figure 2-1 Closing a window with the mouse and with a script
The following sections provide a brief introduction to the AppleScript scripting language by answering frequently asked questions: